import request from "@/utils/request";

//获取商品分类
export const getGoodsCategories = (params) => {
  return request({
    // 请求地址
    url: "/categories",
    // 请求方法
    method: "get",
    params,
  });
};

// 添加分类
export const addCategories = (data) => {
  return request({
    method: "post",
    url: "categories",
    data,
  });
};
// 获取单个分类信息
export const getCategoriesDetail = (id, data) => {
  return request({
    method: "get",
    url: "categories/" + id,
    data,
  });
};
// 编辑提交分类
export const editCategories = (id) => {
  return request({
    method: "put",
    url: "categories/" + id,
  });
};
// 删除分类
export const delCategories = (id) => {
  return request({
    method: "delete",
    url: "categories/" + id,
  });
};
